{% extends 'rebs/layouts/base.html' %}

{% block title %}Rebs{% endblock %}

{% block content %}

    <!-- Start Content-->
    <div class="container-fluid">

        <!-- start page title -->
        {% include 'rebs/partials/content_title.html' with  second_bs="환경 설정" title="회사 정보" %}
        <!-- end page title -->

        <div class="row">
            {% for company in object_list %}
                <div class="col-lg-6">
                    <div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="row mb-3 col-12">
                                    <label for="{{ form.name.id_for_label }}"
                                           class="col-3 col-form-label">회사명</label>
                                    <div class="col-9">
                                        <div class="col-form-label text-black-50">{{ company.name }}</div>
                                    </div>
                                </div>
                                <div class="form-group row mb-3 col-12">
                                    <label for="{{ form.ceo.id_for_label }}"
                                           class="col-3 col-form-label">대표자명</label>
                                    <div class="col-9">
                                        <div class="col-form-label text-black-50">{{ company.ceo }}</div>
                                    </div>
                                </div>
                                <div class="form-group row mb-3 col-12">
                                    <label for="{{ form.business_cond.id_for_label }}"
                                           class="col-3 col-form-label">업태</label>
                                    <div class="col-9">
                                        <div class="col-form-label text-black-50">{{ company.business_cond }}</div>
                                    </div>
                                </div>
                                <div class="form-group row mb-3 col-12">
                                    <label for="{{ form.es_date.id_for_label }}"
                                           class="col-3 col-form-label">설립일자</label>
                                    <div class="col-9">
                                        <div class="col-form-label text-black-50">{{ company.es_date }}</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-lg-6">
                    <div class="card">
                        <div class="card-body">
                            <div class="row">

                                <div class="form-group row mb-3 col-12">
                                    <label for="{{ form.tax_number.id_for_label }}"
                                           class="col-3 col-form-label">사업자등록번호</label>
                                    <div class="col-9">
                                        <div class="col-form-label text-black-50">{{ company.tax_number }}</div>
                                    </div>
                                </div>
                                <div class="form-group row mb-3 col-12">
                                    <label for="{{ form.org_number.id_for_label }}"
                                           class="col-3 col-form-label">법인등록번호</label>
                                    <div class="col-9">
                                        <div class="col-form-label text-black-50">{{ company.org_number }}</div>
                                    </div>
                                </div>
                                <div class="form-group row mb-3 col-12">
                                    <label for="{{ form.business_even.id_for_label }}"
                                           class="col-3 col-form-label">종목</label>
                                    <div class="col-9">
                                        <div class="col-form-label text-black-50">{{ company.business_even }}</div>
                                    </div>
                                </div>
                                <div class="form-group row mb-3 col-12">
                                    <label for="{{ form.op_date.id_for_label }}"
                                           class="col-3 col-form-label">개업일자</label>
                                    <div class="col-9">
                                        <div class="col-form-labe text-black-50l">{{ company.op_date }}</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="form-group row mb-3 col-lg-6">
                                    <label for="{{ form.op_date.id_for_label }}"
                                           class="col-3 col-form-label">회사주소</label>
                                    <div class="col-9">
                                        <div class="col-form-label text-black-50">
                                            {{ company.zipcode }} {{ company.address1 }} {{ company.address2 }} {{ company.address3 }}
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="form-group mb-0 justify-content-end row">
                                    <div class="col-12">
                                        <button class="btn btn-outline-success"
                                                onclick=window.location.href="{% url 'rebs:company:update' company.id %}">
                                            수정하기
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            {% endfor %}
            {% if not object_list %}
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="form-group mb-0 row">
                                    <div class="col-12 m-5 text-danger justify-content-center">
                                       등록된 회사 정보가 없습니다.
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="form-group mb-0 justify-content-end row">
                                    <div class="col-12">
                                        <button class="btn btn-outline-primary"
                                                onclick=window.location.href="{% url 'rebs:company:create' %}">
                                            신규등록
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            {% endif %}

        </div>

    </div> <!-- container -->

{% endblock %}
